#ifndef GYRO_H
#define GYRO_H

#include <stdint.h>
#include <Vector3.h>

class Gyro
{
public:
    void init();
    void update();
    void calibrate();
    inline bool ready()
    {
        return calibrating == 0;
    }
public:
    Vector3f& get_vector()
    {
        return vector;
    }
    //void get_delta_time()

    //int16_t data[3];
private:
    void read(int16_t out[]);
    Vector3f vector;
    int16_t zero[3];
    int16_t calibrating;
    int32_t sum[3];
    int16_t raw[3];
};

#endif